package chapter_14_chain_of_responsibility.classic;

import chapter_14_chain_of_responsibility.classic.base.Request;
import chapter_14_chain_of_responsibility.classic.base.Response;

/**
 * Created by CharloYao on 2017/9/29.
 */
public class Client {

    public static void main(String[] args) {
        //创建所有的处理者
        Handler handler1 = new ConcreteHandler1();
        Handler handler2 = new ConcreteHandler2();
        Handler handler3 = new ConcreteHandler3();
        //设置责任链
        handler1.setNextHandler(handler2);
        handler2.setNextHandler(handler3);

        //创建请求
        Request request = new Request();
        //处理请求，获得响应
        Response response = handler1.handle(request);
    }

}
